package com.buss.core.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.buss.core.dao.RoleDao;
import com.buss.core.model.Role;
import com.buss.core.persistence.OrderBy;
import com.buss.core.persistence.ResultList;
import com.buss.core.service.RoleService;

@Service
public class RoleServiceImpl implements RoleService {

	private static final long serialVersionUID = 1L;

	@Autowired
	private RoleDao roleDao;
	
	public void deleteRole(Long[] ids) {
		roleDao.deleteRole(ids);
		
	}

	public void editRole(Role role) {
		roleDao.editRole(role);
		
	}

	public Role loadRole(Long id) {
		return roleDao.loadRole(id);
	}

	public ResultList<Role> queryRole(String companyId,OrderBy orderBy) {
		return roleDao.queryRole(companyId,orderBy);
	}

	public ResultList<Role> queryRolesByUser(Long userId,OrderBy orderBy){
		return roleDao.queryRolesByUser(userId,orderBy);
	}
	
	public void saveRole(Role role) {
		roleDao.saveRole(role);
		
	}

	public void updateRoleMenu(Role role) {
		roleDao.updateRoleMenu(role);
		
	}

	public void updateRoleUser(Role role) {
		roleDao.updateRoleUser(role);		
	}

}
